<!--
//******************************************************************
//* Copyright (c) 2004 Ford Motor Company. All Rights Reserved.
//*
//*
//* $$Workfile:   fullEconomicsPopup.jsp  $$
//* $$Revision:   1.1  $$
//* $$Author:   TMALDON4  $$
//* $$Date:   Mar 13 2009 11:56:20  $$
//*
//* Description: Description of file goes here
//******************************************************************
-->
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display-el" %>
<%@ taglib uri="ford-arg/tags" prefix="ft" %>

<script language="JavaScript" src="scripts/popups.js"></script>
<script language="JavaScript" src="scripts/ajaxSearch.js"></script>

<script language="javascript">
	
	function lookupSupplier() {
		searchNameSupplier("lookupedSupplier", "supplierCode", "supplierClass");
	}
	
	function lookupPart() {
		searchNamePart("lookupedPart", "partClass", "partPrefix", "partBase", "partSuffix");
	}
	
	function fullEconomicsFind() {
		document.FullEconomicsPopupForm.action = "FullEconomicsPopupActionFind.do";
		document.FullEconomicsPopupForm.section.value = "find";
		document.FullEconomicsPopupForm.submit();	
	}
	
	function selectFullEconomic(fullEconomicCode){
		fullEconomicCodeid = document.FullEconomicsPopupForm.fullEconomicCodeid.value;
		window.opener.document.getElementById(fullEconomicCodeid).value = fullEconomicCode;
		window.close();
	}
	
</script>

<table>
	<tr>
		<td colspan="2"><h2><bean:message key="fullEconomics.excercises.label.title"/></h2></td>
	</tr>
</table>
<br/>
<html:form action="/FullEconomicsPopupActionInit">
<html:hidden property="section"/>
<html:hidden property="fullEconomicCodeid"/>

	<bean:define id="idTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.id" />
	</bean:define>
	<bean:define id="supplierTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.supplier" />
	</bean:define>
	<bean:define id="scopeTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.scope" />
	</bean:define>
	<bean:define id="descriptionTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.description" />
	</bean:define>
	<bean:define id="costStructureTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.costStructure" />
	</bean:define>
	<bean:define id="paymentPolicyTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.paymentPolicy" />
	</bean:define>
	<bean:define id="econLevel1Title">
		<bean:message key="fullEconomics.excercises.label.tableHeader.econLevel1" />
	</bean:define>		
	<bean:define id="econLevel2Title">
		<bean:message key="fullEconomics.excercises.label.tableHeader.econLevel2" />
	</bean:define>
	<bean:define id="creationTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.creation" />
	</bean:define>	
	<bean:define id="proposalTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.proposal" />
	</bean:define>
	<bean:define id="approvalTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.approval" />
	</bean:define>	
	<bean:define id="rejectTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.reject" />
	</bean:define>		
	<bean:define id="obsTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.obs" />
	</bean:define>
	<bean:define id="actionsTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.actions" />
	</bean:define>
	<bean:define id="selectTitle">
		<bean:message key="fullEconomics.excercises.label.tableHeader.select" />
	</bean:define>
	
	<table>
		<tr>
			<td>
				<table>
					<tr>
						<td class="text_blue_bold align_left">							
							<bean:message key="supplier.label.supplier"/>
						</td>
						<td class="align_left">
							<html:select property="supplierTypeSel" styleId="supplierClass">
								<html:option value="-1" key="label.anyOption" />
								<html:options collection="supplierTypeCol" property="value" labelProperty="label" />
							</html:select>
							&minus;
							<html:text property="supplierCode" maxlength="6" size="6" styleId="supplierCode" />
							<html:button property="lookupSupp" onclick="lookupSupplier();" styleClass="button">...</html:button>
							<html:button property="findSupp" onclick="findSupplierPopup('supplierClass', 'supplierCode');" styleClass="button" style="width:25px;">?</html:button>
							<div style="display:inline;" id="lookupedSupplier" />
						</td>
						<td class="text_blue_bold align_right">
							<bean:message key="label.status" />
							<html:select property="statusSel">
								<html:option value="-1" key="label.allOption" />
								<html:options collection="statusCol" property="value" labelProperty="label" />
							</html:select>
						</td>
					</tr>
					<tr>
						<td class="text_blue_bold align_left">
							<bean:message key="commodity.label" />
						</td>
						<td class="align_left">
							<html:select property="commoditySel">
								<html:option value="-1" key="label.allOption"/>
								<html:options collection="commoditiesCol" property="eesp02CommodityNumberK" labelProperty="eesp02CommodityNameN" />
							</html:select>
						</td>
						<td class="text_blue_bold align_right">
							<html:checkbox property="showLastApprovedOnly" value="true" />							
							<bean:message key="fullEconomics.excercises.label.showLastApprovedOnly" />
						</td>					
					</tr>
					<tr>
						<td class="text_blue_bold align_left">
							<bean:message key="part.label" />
						</td>
						<td class="align_left" colspan="2">
							<html:select property="partClassSel" styleId="partClass">
								<html:option value="-1"><bean:message key="label.anyOption" /></html:option>
								<html:options collection="partClassesCol" property="value" labelProperty="label" />
							</html:select>
							&minus;
							<html:text property="partPrefix" maxlength="10" size="10" styleId="partPrefix"/>
							&nbsp;
							<html:text property="partBase" maxlength="10" size="10" styleId="partBase"/>
							&nbsp;
							<html:text property="partSufix" maxlength="10" size="10" styleId="partSuffix"/>
							<html:button property="lookPart" onclick="lookupPart();" styleClass="button">...</html:button>
							<html:button property="findP" onclick="findPartPopup('supplierClass', 'supplierCode', 'partClass', 'partPrefix', 'partBase', 'partSuffix');" styleClass="button" style="width:25px;">?</html:button>
							<div style="display:inline;" id="lookupedPart" />
						</td>					
					</tr>
					<tr>
						<td class="text_blue_bold align_left">
							<bean:message key="fullEconomics.excercises.label.date" />
						</td>
						<td class="text_blue_bold align_left" colspan="2">
							<html:select property="dateTypeSel">
								<html:options collection="dateTypesCol" property="value" labelProperty="label" />
							</html:select>
							<bean:message key="fullEconomics.excercises.label.between" />
							<html:text property="dateMin" maxlength="10" size="10" />
							<bean:message key="label.and" />
							<html:text property="dateMax" maxlength="10" size="10" />
							&nbsp;&nbsp;
							<bean:message key="label.user" />
							<html:select property="userActionTypeSel">
								<html:options collection="userActionsTypesCol" property="value" labelProperty="label" />
							</html:select>
							<html:text property="userId" size="8" maxlength="8" />
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
					</tr>
					<tr>
						<td class="text_blue_bold align_left">
							<bean:message key="fullEconomics.excercises.label.econLevel1Between" />
						</td>
						<td class="text_blue_bold align_left" colspan="2">
							<html:text property="econLevel1MinDate" maxlength="10" size="10" />
							<bean:message key="label.and" />
							<html:text property="econLevel1MaxDate" maxlength="10" size="10" />
							<bean:message key="fullEconomics.excercises.label.econLevel2Between" />
							<html:text property="econLevel2MinDate" maxlength="10" size="10" />
							<bean:message key="label.and" />
							<html:text property="econLevel2MaxDate" maxlength="10" size="10" />
						</td>
					</tr>
					<tr class="align_right">
						<td colspan="100%" class="align_right">
							<html:button property="cleanScreen" onclick="clean();" styleClass="button"><bean:message key="label.clean" /></html:button>							
							<html:button property="findFullE" onclick="fullEconomicsFind();" styleClass="button"><bean:message key="label.find" /></html:button>
						</td>
					</tr>
				</table>
			</td>		
		</tr>		
		<tr>
			<td style="height:15px;" colspan="100%" />
		</tr>
		<tr>
			<td>
				<table>
					<tr>
						<td colspan="100%">
							<ft:saveActivePageNumber />
							<display-el:table 	class="table1" style="width: 800px;" cellpadding="5" uid="fullEconomics"
												name="sessionScope.FullEconomicsPopupForm.fullEconomics"  pagesize="15"
												excludedParams="*" requestURI="FullEconomicsExcercisesActionPaginate.do">
								<display-el:column title="${idTitle}" property="eesf01FulleNumberK" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right"/>								
								<display-el:column title="${supplierTitle}" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">								
									${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teess01Supplier.eess01SupplierClassCodeC }&nbsp;&minus;
									${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teess01Supplier.eess01SupplierCodeC }&nbsp;&minus;
									${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teess01Supplier.eess01SupplierNameN }
								</display-el:column>
								
								<display-el:column title="${scopeTitle}" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
									<logic:equal name="fullEconomics" property="teesc02Coststvers.teesc01Coststruct.eesc01CststrTypeCodeC" value="S">*</logic:equal>
									<logic:equal name="fullEconomics" property="teesc02Coststvers.teesc01Coststruct.eesc01CststrTypeCodeC" value="C">
										${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teesp02Commodity.eesp02CommodityNameN }
									</logic:equal>
									<logic:equal name="fullEconomics" property="teesc02Coststvers.teesc01Coststruct.eesc01CststrTypeCodeC" value="P">
										<div title="${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teesp04Supply.teesp01Part.eesp01PartDescriptionX }">
											${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teesp04Supply.teesp01Part.eesp01PartClassCodeC }&nbsp;
											${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teesp04Supply.teesp01Part.eesp01PartPrefixCodeC }&minus;
											${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teesp04Supply.teesp01Part.eesp01PartBaseCodeC }&minus;
											${ fullEconomics.teesc02Coststvers.teesc01Coststruct.teesp04Supply.teesp01Part.eesp01PartSuffixCodeC }
										</div>
									</logic:equal>
								</display-el:column>
								
								<display-el:column title="${descriptionTitle}" property="teesc02Coststvers.teesc03Subcoststr.eesc03SubcstNameN" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />								
								<display-el:column title="${costStructureTitle}" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
									${ fullEconomics.teesc02Coststvers.teesc01Coststruct.eesc01CststrNumberK }.${ fullEconomics.teesc02Coststvers.eesc02CststvVersionNumberK }
								</display-el:column>
								
								<display-el:column title="${econLevel1Title}" property="eesf01FulleEcolevel1DateY" decorator="ar.com.ford.it.fullEconomics.view.displaytag.DateDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right"/>
								<display-el:column title="${econLevel2Title}" property="eesf01FulleEcolevel2DateY" decorator="ar.com.ford.it.fullEconomics.view.displaytag.DateDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right"/>
								<display-el:column title="${creationTitle}" decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
									${ fullEconomics.eesf01CreateUserC }<br />${ fullEconomics.eesf01CreateS }
								</display-el:column>
								
								<display-el:column title="${proposalTitle}" decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
									<logic:empty name="fullEconomics" property="eesf01FulleProposalUserC">
										&minus;
									</logic:empty>
									<logic:notEmpty name="fullEconomics" property="eesf01FulleProposalUserC">
										${fullEconomics.eesf01FulleProposalUserC}<br />${fullEconomics.eesf01FulleProposalS}
									</logic:notEmpty>									
								</display-el:column>
								
								<display-el:column title="${approvalTitle}" decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">
									<logic:empty name="fullEconomics" property="eesf01FulleApprovalUserC">
										&minus;
									</logic:empty>
									<logic:notEmpty name="fullEconomics" property="eesf01FulleApprovalUserC">
										${fullEconomics.eesf01FulleApprovalUserC}<br />${fullEconomics.eesf01FulleApprovalS}
									</logic:notEmpty>								
								</display-el:column>

								<display-el:column title="${rejectTitle}" decorator="ar.com.ford.it.fullEconomics.view.displaytag.CostStructureItemColumnDecorator" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">											
									<logic:empty name="fullEconomics" property="eesf01FulleRejectUserC">
										&minus;
									</logic:empty>
									<logic:notEmpty name="fullEconomics" property="eesf01FulleRejectUserC">
										${fullEconomics.eesf01FulleRejectUserC}<br />${fullEconomics.eesf01FulleRejectS}
									</logic:notEmpty>								
								</display-el:column>								
								
								<display-el:column title="${actionsTitle}" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right">																
									<a href="javascript:selectFullEconomic('${fullEconomics.eesf01FulleNumberK}');"><bean:message key="fullEconomics.popup.select" /></a>
								</display-el:column>
								
							</display-el:table>
						</td>
					</tr>
				</table>			
			</td>		
		</tr>
	</table>
</html:form>
